<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<div class="container-fluid">
<div class="row-fluid">
<div class="span2"></div>
<div class="span8" style="margin-top:15px">
<div class="row-fluid">
<div class="span4">
<a href="home"><img alt="logo" src="ViewResource/img/book-3.png" /></a>
<div class="pull-right">
</div>
<br />
</div>
<div class="span8">
<div class="row-fluid">
<div class="pull-right" >
<iframe src="//www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2Fbookyourtrek&amp;width=100&amp;height=21&amp;colorscheme=light&amp;layout=button_count&amp;action=like&amp;show_faces=false&amp;send=false" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:21px;" allowTransparency="true"></iframe> 
<!-- Place this tag where you want the +1 button to render. -->
<div class="g-plusone" data-size="medium" data-href="https://plus.google.com/u/0/b/108381263598567142455/108381263598567142455/posts"></div>

<!-- Place this tag after the last +1 button tag. -->
<script type="text/javascript">
  (function() {
    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
    po.src = 'https://apis.google.com/js/plusone.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
  })();
</script>
<a href="https://twitter.com/bookyourtrek" class="twitter-follow-button" data-show-count="false" data-show-screen-name="false">Follow @bookyourtrek</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
</div>

</div>
<br />
<br />
<div class="row-fluid">
<div class="pull-right">
<!-- <div style="position: fixed;">  -->
<a class="btn btn-primary" href="home">Home</a>&nbsp;<a class="btn btn-primary" href="createadventure">Create an Adventure</a>
<!-- If user is loggedin show account page -->
<s:if test="#session['login']!=null">
<div class="btn-group">
  <a class="btn btn-info dropdown-toggle" data-toggle="dropdown" href="#">
    <s:property value="#session['useremail']" />
    <span class="caret"></span>
  </a>
  <ul class="dropdown-menu">
  <li><a href="userdashboard">DashBoard</a></li>
    <li><a href="useraccount">Account</a></li>
    <li><a href="userlogout">Logout</a></li>
  </ul>
</div>
</s:if>
<!-- If user is loggedin show account page -->

<!-- if user is not logged in show login/register button group -->
<s:else>
<div class="btn-group">
  <a href="#loginmodal" class="btn btn-info" data-toggle="modal">Login</a>
  <a href="#registermodal" class="btn btn-info" data-toggle="modal">Register</a>
</div>
</s:else>
</div>
<!-- if user is not loggedin show login/register button group ends here-->
</div>
</div>
</div>
</div>
<!-- </div> -->
</div>
<div class="span2"></div>
</div>
<!-- login modal -->
<!-- Modal -->
<div id="loginmodal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    <h3 id="myModalLabel">Login</h3>
  </div>
  <div class="modal-body">
    <p>
    <!-- login form -->
    <s:form theme = "simple" cssClass="form-inline" action="userlogin" method="post" validate="true">
  		<s:if test="hasFieldErrors()">
   			<!-- <div class="alert alert-error">  -->
  		 		<s:fielderror><s:param>email</s:param></s:fielderror>
  		 		<s:fielderror><s:param>password</s:param></s:fielderror>
  		 		<s:fielderror><s:param>mismatch</s:param></s:fielderror>
  		 		<s:fielderror><s:param>account</s:param></s:fielderror>
  		 <!-- </div> -->
  		 </s:if>
  		<div class="control-group">
  		<div class="controls">
  		<s:textfield name="email" cssClass="input-large" placeholder="Enter Email"></s:textfield>
  		<s:password name="password" cssClass="input-medium" placeholder="Enter Password"></s:password>
  		<s:submit name="signin" theme = "simple" cssClass="btn btn-success" value="Login"></s:submit>
  		<br /><br /><a id="hideloginmodal" href="#forgotpasswordmodal" data-toggle="modal">forgot password?</a>
  		</div>
  		</div>
  		<!-- remember me will be implimented later -->
  		<!-- 
  		<div class="control-group">
  		<div class="controls">
  		<label class="checkbox">
    	<s:checkbox name="rememberme" fieldValue="true" value="true" label="">Remember Me</s:checkbox>
  		</label>
  		</div>
  		</div>
  		 -->
	</s:form>
    <!-- login form ends here-->
    </p>
  </div>
  <div class="modal-footer">
    <button class="btn btn-primary" data-dismiss="modal" aria-hidden="true">Cancel</button>
  </div>
</div>
<!-- login modal ends here -->

<!-- register modal -->
<!-- Modal -->
<div id="registermodal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    <h3 id="myModalLabel">Register</h3>
  </div>
  <div class="modal-body">
    <p>
    <!-- register form -->
    <s:form theme = "simple" cssClass="form-inline" action="userregister" method="post" validate="true">
  		<s:if test="hasFieldErrors()">
   			<!-- <div class="alert alert-error">  -->
  		 		<s:fielderror><s:param>remail</s:param></s:fielderror>
  		 		<s:fielderror><s:param>rpassword</s:param></s:fielderror>
  		 		<s:fielderror><s:param>alreadyregistered</s:param></s:fielderror>
   			<!-- </div> --> 
		</s:if> 
  		<div class="control-group">
  		<div class="controls">
  		<s:textfield name="remail" cssClass="input-large" placeholder="Enter Email"></s:textfield>
  		<s:textfield name="rphone" cssClass="span2" placeholder="Enter Phone"></s:textfield>
  		<s:password name="rpassword" cssClass="span2" placeholder="Enter Password"></s:password>
  		<br /><br /><s:submit name="register" theme = "simple" cssClass="btn btn-success" value="Register"></s:submit>
  		</div>
  		</div>
  		<!-- terms and condition check box will be made later -->
	</s:form>
    <!-- register form ends here-->
    </p>
  </div>
  <div class="modal-footer">
    <button class="btn btn-primary" data-dismiss="modal" aria-hidden="true">Cancel</button>
  </div>
</div>
<!-- register modal ends here -->

<!-- forgot password modal -->
<div id="forgotpasswordmodal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    <h3 id="myModalLabel">Forgot Password</h3>
  </div>
  <div class="modal-body">
<p>
<!-- forgot password form -->
    <s:form theme = "simple" cssClass="form-inline" action="userrequestpassword" method="post" validate="true">
  		<s:if test="hasFieldErrors()">
   			<!-- <div class="alert alert-error">  -->
  		 		<s:fielderror><s:param>forgotemail</s:param></s:fielderror>
   			<!-- </div> --> 
		</s:if> 
  		<div class="control-group">
  		<div class="controls">
  		<s:textfield name="forgotemail" cssClass="input-xlarge" placeholder="Enter Email"></s:textfield>
  		<s:submit name="forgot" theme = "simple" cssClass="btn btn-success" value="Submit"></s:submit>
  		</div>
  		</div>
  		</s:form>
</p>
  </div>
  <div class="modal-footer">
    <button class="btn btn-primary" data-dismiss="modal" aria-hidden="true">Cancel</button>
  </div>
</div>
<!-- forgot password modal ends here -->
<hr />